package utils;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ThreadPoolDisTributed extends ThreadPoolExecutor {
	private ThreadPoolDisTributed(int corePoolSize,int maximumPoolSize,long keepAliveTime,TimeUnit unit,
			BlockingQueue<Runnable> workQueue){
		super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
	}
	private static BlockingQueue<Runnable> queue=new LinkedBlockingQueue<Runnable>();
	
	private static ThreadPoolDisTributed threadPool=new ThreadPoolDisTributed(20,30,30000,TimeUnit.MILLISECONDS,queue);
	
	public static ThreadPoolDisTributed getInstance(){
		return threadPool;
	}
	
	@Override
	public void execute(Runnable command){
		super.execute(command);
	}
}
